package cn.bopomo.dealer.base.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import cn.bopomo.dealer.base.common.ServiceConfig;
import cn.bopomo.dealer.base.service.IOperatorService;
import cn.bopomo.dealer.base.vo.ModuleList;

public class ShowModuleDetailAction extends BaseAction {

	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		if (!this.hasPermission(request)){
			return this.findFailure(mapping);
		}
		
		String moduleId = request.getParameter("mid");
		
		
		
		IOperatorService os = (IOperatorService)this.findService(ServiceConfig.OPERATOR_SERVICE);
		ModuleList module = os.getModule(new Integer(moduleId));
		
		if (module != null)
			request.setAttribute("module",module);
		
		return this.findSuccess(mapping);
	}

}
